<template>
	<view>
		<view class="transfer-goods page">
			<view class="con">
				<view class="stores">
					<view class="item border-bottom-1px" v-for="(store,index) in storeList"
						 :key="index">
						<img :src="'http://images.zmzpl.com/'+store.goods.img" alt="" class="img">
						<view class="info" @click="selectItem(index)">
							<text class="name">{{store.goods.name}}</text>
							<text class="quantity">库存:{{store.store.quantity}}</text>
						</view>
						<view class="active" v-if="store.goods.name&&store.goods.name.indexOf('课程')>-1" @click="active(store.store.id,store.goods.profit)">激活</view>
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import {list} from "@/api/store"
	import {getAddress} from "@/api/order"
	import {active} from "@/api/course"
	export default {
		data() {
			return {
				storeList:[]
			}
		},
		methods: {
			async list(){
				const {data:res} = await list()
				this.storeList = res
				// console.log(this.storeList)
			}
		},
		onLoad() {
			this.list()
		}
	}
</script>

<style scoped lang="stylus">
    .transfer-goods
        // background url("~@/assets/hbg.png") no-repeat $page-bg
        // background-size 100% auto
        z-index 2
        height 100%

        .con
            padding 20rpx 20rpx 0

            .header
                border-radius 5px
                background-color white
                display flex
                justify-content space-between
                padding 0 30rpx
                height 88rpx
                align-items center

                .left
                    height 100%
                    display flex
                    align-items center

                    .name
                        font-size: 28rpx;
                        font-family: PingFang SC;
                        font-weight: 400;
                        color: rgba(111, 111, 111, 1);

                    .right
                        color #A1A1A1
                        margin-left 10rpx
                        font-size 20rpx

                .right
                    height 100%
                    display flex
                    align-items center
                    font-size 28rpx
                    color #A1A1A1

                    .line
                        font-size 28rpx
                        margin 0 20rpx
                        color #A1A1A1

                    .edit
                        &.selected
                            color #F7895E

                    .reset
                        &.selected
                            color #F7895E

            .stores
                background-color white
                margin-top 20rpx
                border-radius 10rpx
                overflow hidden

                .item
                    position relative
                    border-bottom-color #DCDCDC
                    height 160rpx
                    display flex
                    align-items center

                    .iconfont
                        font-size 36rpx
                        color #F7895E
                        position absolute
                        right 60rpx
                        top 60rpx

                    .img
                        width 100rpx
                        height 100rpx
                        border-radius 5px
                        margin 0 30rpx
                        flex 0 0 100rpx

                    .info
                        flex 1
                        display flex
                        flex-direction column
                        height 100rpx

                        .name
                            text-wrap none
                            text-overflow ellipsis
                            font-size: 28rpx;
                            font-family: PingFang SC;
                            font-weight: 300;
                            color: rgba(78, 61, 7, 1);
                            margin 10rpx 0px 20rpx

                        .quantity
                            font-size: 24rpx;
                            font-family: PingFang SC;
                            font-weight: 300;
                            color: rgba(161, 161, 161, 1);
                    .active
                        font-size 24rpx
                        width 80rpx
                        color  red




</style>
